package com.smh.a05exerciseDemo2;

import java.util.ArrayList;
import java.util.Collections;

public class Test1 {
    public static void main(String[] args) {

        ArrayList<String> list = new ArrayList<>();

        Collections.addAll(list,"杨幂,30","刘涛,28","关晓彤,27","白鹿,28","白百合,30","赵丽颖,32","杨颖,32");

        Student[] array = list.stream().map(Student::new).toArray(Student[]::new);
        for (Student student : array) {
            System.out.println(student);
        }

    }
}
